<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//
			function getMax() {
				var max = arguments[0];
				for (i = 1; i < arguments.length; i++) {
					if (arguments[i] > max) {
						max = arguments[i];
					}
				}
				return max;
			}
			console.log(getMax(1, 5, 9, 77));
			console.log(getMax(99, 777, 555, 4));

			//翻转数组
			function reverse(arr) {
				var newarr = [];
				for (var i = arr.length; i >= 0; i--) {
					newarr[newarr.length] = arr[i];
				}
				return newarr;
			}
			var arr1 = reverse([1, 2, 3, 4, 5, 6]);
			console.log(arr1);

			//冒泡排序
			function sort(arr) {
				for (var i = 0; i < arr.length - 1; i++) {
					for (var j = 0; j < arr.length - i - 1; j++) {
						if (arr[j] > arr[j + 1]) {
							var temp = arr[j];
							arr[j] = arr[j + 1];
							arr[j + 1] = temp;
						}
					}
				}
				return arr;
			}
			var arr1 = sort([4, 7, 2, 6, 9, 1, 3]);
			console.log(arr1);

			//判断闰年
			function isRun(year) {
				var flag = false;
				if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
					flag = true;
				}
				return flag;
			}
			var year1 = isRun(1998);
			console.log(year1);
		</script>
	</head>
	<body>
	</body>
</html>
